import request from '../utils/fetch'
//-------我的工种
//我的工种列表
export function craftList(data) {
    return request({
        url: '/api/worker/craft/list',
        method: 'get',
        loading: false,
        params: data
    })
}
//获取选择工种列表
export function enableList() {
    return request({
        url: '/craft/list/enable',
        method: 'get',
        loading: true,

    })
}
//获取意向工作地
export function cityList(data) {
    return request({
        url: '/region/list/city',
        method: 'get',
        loading: true,
        params: data

    })
}
//添加工种
export function addCraft(data) {
    return request({
        url: '/api/worker/add/craft',
        method: 'post',
        loading: true,
        data: data
    })
}
//我的工种详情
export function craftInfo(data) {
    return request({
        url: '/api/worker/craft/info',
        method: 'post',
        loading: true,
        data: data
    })
}
//删除工种
export function deleteCraft(data) {
    return request({
        url: '/api/worker/delete/craft',
        method: 'post',
        loading: true,
        data: data
    })
}
//修改工种
export function updateCraft(data) {
    return request({
        url: '/api/worker/update/craft',
        method: 'post',
        loading: true,
        data: data
    })
}


//进行中
export function doingList(data) {
    return request({
        url: '/api/recruit/project/doing/list',
        method: 'get',
        loading: false,
        params: data
    })
}

//待发布
export function waitList(data) {
    return request({
        url: '/api/recruit/project/wait/list',
        method: 'get',
        loading: false,
        params: data
    })
}
//已结束
export function endList(data) {
    return request({
        url: '/api/recruit/project/end/list',
        method: 'get',
        loading: false,
        params: data
    })
}


//删除招工
export function delcraft(data) {
    return request({
        url: '/api/foreman/project/del/craft',
        method: 'post',
        loading: true,
        data: data
    })
}

//申请退款
export function refund(data) {
    return request({
        url: '/pay/refund',
        method: 'post',
        loading: true,
        data: data
    })
}
//结束招工
export function stop(data) {
    return request({
        url: '/api/foreman/project/stop',
        method: 'post',
        loading: true,
        data: data
    })
}
//用户获取确认函信息接口
export function receiveConfirmation(data) {
    return request({
        url: '/api/worker/receive/confirmation/info',
        method: 'get',
        loading: false,
        params: data
    })
}

//是否接受确认函
/*
confirmationId: this.data.confirmation.confirmationId,
isAccept: parms.isaccept //1 接受 2 拒绝
*/
export function acceptConfirmation(data) {
    return request({
        url: '/api/worker/confirmation/accept',
        method: 'get',
        loading: true,
        params: data
    })
}